﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<SportStore.DomainModel.Entities.Product>>" %>
<%@ Import Namespace="SportStore.DomainModel.Entities" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <h2>List</h2>

    <% foreach (Product product in Model) {
           Html.RenderPartial("ProductSummary", product);
       } %>

    <div class="pager">
        Page : <%= Html.PageLinks((int) ViewData["CurrentPage"], (int) ViewData["TotalPages"], x=>Url.Action("List", new {page=x, category=ViewData["CurrentCategory"]})) %>
    </div>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
    SportsStore: 
    <%= string.IsNullOrEmpty((string)ViewData["CurrentCategory"]) ? "All Products" : Html.Encode(ViewData["CurrentCategory"])%>
</asp:Content>
